package com.fzkj.shejimoshi.factory.factory;

import com.fzkj.shejimoshi.factory.factory.phone.Phone;
import com.fzkj.shejimoshi.factory.factory.phonefactory.AbstractPhoneFactory;
import com.fzkj.shejimoshi.factory.factory.phonefactory.AndroidPhoneFactory;
import com.fzkj.shejimoshi.factory.factory.phonefactory.ApplePhoneFactory;

/**
 * @DESCRIPTION: TODO 测试工厂方法模式
 * @AUTHOR: AnotherOne
 * @DATE: 2021/8/12 14:12
 */
public class Test {

    public static void main(String[] args) {
        AbstractPhoneFactory factory = new ApplePhoneFactory();
        Phone phone = factory.newPhone();
        System.out.println(phone.show());
        System.out.println("==============");
        factory = new AndroidPhoneFactory();
        Phone phone1 = factory.newPhone();
        System.out.println(phone1.show());
    }

}
